surface: Cosmetics
authorMatthias Clasen <mclasen@redhat.com>
Sun, 26 May 2019 03:55:08 +0000 (03:55 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:17 +0000 (20:25 +0000)
Move things where they belong.

gdk/gdksurface.c

index 28f8f584e9000f4753cd7079f95f7c39674c7672..b3f0c64223b3244e88a57edb79c3fd8bb06e29b2 100644 (file)
@@ -663,10 +663,14 @@ gdk_surface_set_property (GObject      *object,
     case PROP_DISPLAY:
       surface->display = g_value_dup_object (value);
       g_assert (surface->display != NULL);
+      g_signal_connect (surface->display, "seat-removed",
+                        G_CALLBACK (seat_removed_cb), surface);
       break;
 
     case PROP_PARENT:
       surface->parent = g_value_dup_object (value);
+      if (surface->parent != NULL)
+        surface->parent->children = g_list_prepend (surface->parent->children, surface);
       break;
 
     case PROP_FRAME_CLOCK:
@@ -753,21 +757,10 @@ gdk_surface_new (GdkDisplay     *display,
                  int             width,
                  int             height)
 {
-  GdkSurface *surface;
-
-  surface = gdk_display_create_surface (display,
-                                        surface_type,
-                                        parent,
-                                        x, y, width, height);
-
-  surface->parent = parent;
-  if (parent)
-    parent->children = g_list_prepend (parent->children, surface);
-
-  g_signal_connect (display, "seat-removed",
-                    G_CALLBACK (seat_removed_cb), surface);
-
-  return surface;
+  return gdk_display_create_surface (display,
+                                     surface_type,
+                                     parent,
+                                     x, y, width, height);
 }
 
 /**